<template>
  <div class="question-header">
    <h1>{{ detail }}</h1>
    <div class="meta-info">
      <span class="difficulty">难度：{{ getDifficultyText(difficult) }}</span>
      <span class="score">分值：{{ score }}分</span>
    </div>
  </div>
</template>

<script setup lang="ts">
defineProps({
  detail: {
    type: String,
    default: ''
  },
  difficult: {
    type: Number,
    default: 1
  },
  score: {
    type: Number,
    default: 0
  }
})

const difficultyMap:{[key:number]:string} = {
    1: '简单',
    2: '中等',
    3: '困难'
  }

// 获取难度文字
const getDifficultyText = (difficult:number) => {
  
  return difficultyMap[difficult] || '未知'
}
</script>

<style scoped>
.question-header {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  padding: 20px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 24px;
}

.question-header h1 {
  font-size: 24px;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.95);
}

.meta-info {
  display: flex;
  gap: 16px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

.difficulty,
.score {
  display: flex;
  align-items: center;
  gap: 4px;
}
</style>